Basic Examples ; -d+(-.-d-d)?, contains a positive integer or a floating point number with exactly two characters after the decimal point. ; [^i*&2@], contains ...
JavaScript Regular Expressions ; Example. Use a string to do a search for W3schools in a string: · Visit W3Schools!; let n = text.search(W3Schools);. JavaScript Operator Precedence · JavaScript String Methods · Try it Yourself · Try it
For example, the regex [02468] matches a single digit 0 , 2 , 4 , 6 , or 8 ; the regex [^02468] matches any single character other than 0 , 2 , 4 , 6 , or 8 .